// subpkg/health/health.js

var wxCharts = require('../../utils/wxcharts.js');

var lineChart = null;
Page({
  /**
   * 页面的初始数据
   */
  data: {
    startTime2:'',
    endTime2:'',
    display:'block',
    date:'今日健康',
    date1:'最近一周',
    max_date:new Date().getTime(),
    min_date:new Date(2023,8,1).getTime(),
    show:false,
    show1:false,
    startTime:'',
    endTime:'',
    heartRateList:
    [
      {
        time:'',
        count:'',
      }
    ],
    bloodGlucose_empty:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_beforeBreakfast:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_afterBreakfast:
    [
        {
          time:'',
          count:'',
        }
    ],

    bloodGlucose_beforeLunch:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_afterLunch:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_beforeDinner:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_afterDinner:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_beforeSleep:
    [
        {
          time:'',
          count:'',
        }
    ],
    bloodGlucose_beforeDawn:
    [
        {
          time:'',
          count:'',
        }
    ],

    pressureList:
    [
      {
        diastolicPressure:
        {
          time:'',
          count:'',
        },
        systolicPressure:
        {
          time:'',
          count:'',
        }
      }
    ],
    
    
    
    weightList:
    [
      {
        time:'',
        count:'',
      }
    ],
   
    temperatureList:
    [
      {
        oralTemperature:
        {
          time:'',
          count:'',
        },
        axillaryTemperature:
        {
          time:'',
          count:'',
        },
        rectalTemperature:
        {
          time:'',
          count:'',
        }
      }
    ],
    activeNames: ['1'],
    width:'',
    heart_rate:'',
    weight:'',
    axillaryTemperature:'',
    oralTemperature:'',
    rectalTemperature:'',
    systolicPressure:'',
    diastolicPressure:'',
    bloodSugar:'',
    bloodSugar_empty:'',
    bloodSugar_b_b:'',
    bloodSugar_a_b:'',
    bloodSugar_b_l:'',
    bloodSugar_a_l:'',
    bloodSugar_b_d:'',
    bloodSugar_a_d:'',
    bloodSugar_b_s:'',
    bloodSugar_b_dawn:'',
    background1:'pink',
    background2:'#fff',
    background3:'#fff',
    background4:'#fff',
    background5:'#fff',
    textcolor1:'#014f8e',
    textcolor2:'#bfbfbf',
    textcolor3:'#bfbfbf',
    textcolor4:'#bfbfbf',
    textcolor5:'#bfbfbf',
    systolicPressure_x_data:[],
    diastolicPressure_x_data:[],
    systolicPressure_y_data:[],
    diastolicPressure_y_data:[],
    axillaryTemperature_x_data:[],
    oralTemperature_x_data:[],
    rectalTemperature_x_data:[],
    axillaryTemperature_y_data:[],
    oralTemperature_y_data:[],
    rectalTemperature_y_data:[],
    heartRate_x_data:[],
    heartRate_y_data:[],
    bloodGlucose_empty_x_data:[],
    bloodGlucose_afterBreakfast_x_data:[],
    bloodGlucose_beforeBreakfast_x_data:[],
    bloodGlucose_beforeLunch_x_data:[],
    bloodGlucose_afterLunch_x_data:[],
    bloodGlucose_afterDinner_x_data:[],
    bloodGlucose_beforeDinner_x_data:[],
    bloodGlucose_beforeSleep_x_data:[],
    bloodGlucose_beforeDawn_x_data:[],
    bloodGlucose_empty_y_data:[],
    bloodGlucose_afterBreakfast_y_data:[],
    bloodGlucose_beforeBreakfast_y_data:[],
    bloodGlucose_beforeLunch_y_data:[],
    bloodGlucose_afterLunch_y_data:[],
    bloodGlucose_afterDinner_y_data:[],
    bloodGlucose_beforeDinner_y_data:[],
    bloodGlucose_beforeSleep_y_data:[],
    bloodGlucose_beforeDawn_y_data:[],
    weight_x_data:[],
    weight_y_data:[],
    x_data:[],
    y_data:[]


  },

  onDisplay() {
    this.setData({
       show: true,
       display:'none'
      });
  },
  onClose() {
    this.setData({ 
      show: false,
      display:'block'
    });
  },
  onDisplay1() {
    this.setData({ 
      show1: true,
      display:'none'
     });
  },
  onClose1() {
    this.setData({
       show1: false,
       display:'block'
       });
  },
  formatDate(date) {
    date = new Date(date);
    return `${date.getMonth() + 1}/${date.getDate()}`;
  },
  onConfirm(event) {
    var start = event.detail
    var end = event.detail
    var year = start.getFullYear()
    var month = start.getMonth() + 1 <10?'0'+(start.getMonth() + 1):start.getMonth() + 1
    var day = start.getDate()
    var year1 = end.getFullYear()
    var month1 = end.getMonth() + 1 <10?'0'+(end.getMonth() + 1):end.getMonth() + 1
    var day1 = end.getDate()
    var startTime = `${year}-${month}-${day}T00:00`
    var endTime = `${year1}-${month1}-${day1}T23:59`
    this.setData({
      display:'block',
      show: false,
      startTime2:startTime,
      endTime2:endTime,
      date:`${this.formatDate(start)}`
    });
    this.getHealthList(startTime,endTime)
  },

  onConfirm1(event) {
    
    const [start, end] = event.detail;
    var year = start.getFullYear()
    var month = start.getMonth() + 1 <10?'0'+(start.getMonth() + 1):start.getMonth() + 1
    var day = start.getDate()
    var year1 = end.getFullYear()
    var month1 = end.getMonth() + 1 <10?'0'+(end.getMonth() + 1):end.getMonth() + 1
    var day1 = end.getDate()
    var startTime = `${year}-${month}-${day}T00:00`
    var endTime = `${year1}-${month1}-${day1}T23:59`
    this.setData({
      display:'block',
      show1: false,
      startTime:startTime,
      endTime:endTime,
      date1:`${this.formatDate(start)}-${this.formatDate(end)}`,
      textcolor1:'#014f8e',
      textcolor2:'#bfbfbf',
      textcolor3:'#bfbfbf',
      textcolor4:'#bfbfbf',
      textcolor5:'#bfbfbf',
      background1:'pink',
      background2:'#fff',
      background3:'#fff',
      background4:'#fff',
      background5:'#fff',
    });
    this.getHealthList(startTime,endTime)
  },

  

  onChange(event) {
    this.setData({
      activeNames: event.detail,
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if(wx.getStorageSync('identity') === '游客'){
      Dialog.confirm({
        title: '提醒',
        message: '您当前是游客身份，请绑定后享受更多服务!',
      })
        .then(() => {
          // on confirm
          wx.redirectTo({
            url: '/subpkg_worker/login/login',
          })
        })
        .catch(() => {
          console.log(111)
          // on cancel
          wx.switchTab({
            url: '/pages/home/home',
          })
        });
    }
    var windowWidth = wx.getSystemInfoSync().windowWidth/750*690
    this.setData({
      width:windowWidth
    })
    var x_data = []
    var y_data = []
    var range = [60,180]
     
    var date = new Date()
    var year = date.getFullYear()
    var month = date.getMonth()+1<10?'0'+(date.getMonth()+1):date.getMonth()+1
    var day = date.getDate() < 10?'0'+date.getDate():date.getDate()
    var endTime = `${year}-${month}-${day}T23:59`
    var date1 = new Date(date.getTime()-6*24*60*60*1000)
    var year1 = date1.getFullYear()
    var month1 = date1.getMonth()+1<10?'0'+(date1.getMonth()+1):date1.getMonth()+1
    var day1 = date1.getDate() < 10?'0'+date1.getDate():date1.getDate()
    var startTime = `${year1}-${month1}-${day1}T00:00`
    
    console.log(startTime)
    console.log(endTime)
    this.setData({
      startTime:startTime,
      endTime:endTime
    })
    
    //一周
    this.getHealthList(startTime,endTime)
    //今天
    var date2 = new Date()
    var year2 = date2.getFullYear()
    var month2 = date2.getMonth()+1<10?'0'+(date2.getMonth()+1):date2.getMonth()+1
    var day2 = date2.getDate()
    var startTime2 =  `${year2}-${month2}-${day2}T00:00`
    var endTime2 = `${year2}-${month2}-${day2}T23:59`
    this.getHealthList(startTime2,endTime2)
    this.setData({
      startTime2:startTime2,
      endTime2:endTime2
    })
     //绘制折线图
    if(this.data.heartRate_x_data.length===0){
      this.OnWxChart(x_data,y_data,'心率',range)

    }
  },
  
  getHealthList(startTime,endTime){
    this.querybloodGlucoses('空腹',startTime,endTime)
    this.querybloodGlucoses('早餐后',startTime,endTime)
    this.querybloodGlucoses('早餐前',startTime,endTime)
    this.querybloodGlucoses('午餐后',startTime,endTime)
    this.querybloodGlucoses('午餐前',startTime,endTime)
    this.querybloodGlucoses('晚餐后',startTime,endTime)
    this.querybloodGlucoses('晚餐前',startTime,endTime)
    this.querybloodGlucoses('睡前',startTime,endTime)
    this.querybloodGlucoses('凌晨',startTime,endTime)
     this.querybloodPressure(startTime,endTime)
     this.queryheartRate(startTime,endTime)
     this.queryTemperature(startTime,endTime)
     this.queryWeight(startTime,endTime)
  },

  queryWeight(startTime,endTime){
    var startTime = startTime.replace('T',' ')
    var endTime = endTime.replace('T',' ')
    const that = this
    wx.request({
      url: 'https://zhixiao.site:8080/health/bodyWeight',
      data:{
        startTime:startTime,
        endTime:endTime,
        id:wx.getStorageSync('elderId')
      },
      header:{
        'Cookie':wx.getStorageSync('JSESSIONID')
      },
      success:(res)=>{
        if(startTime.slice(0,10)==endTime.slice(0,10)){
          var weight = res.data.data
          if(weight == null){
            this.setData({
              weightList:
              [
                {
                  time:'',
                  count:'',
                }
              ]
            })
            return
          }
          var weightList = []
          for(var i in weight){
            var obj = {}
            obj.time = weight[i].createdTime.slice(11,16)
            obj.count = weight[i].weight
            weightList.push(obj)
          }
          this.setData({
            weightList:weightList
          })
          return
          
        }
        console.log("体重")
        console.log(res)
        if(res.data.data===null){
          return
        }
        
        var weight = res.data.data
        var weight_x_data = []
        var weight_y_data = []
        for (var i in weight){
          weight_x_data.push(weight[i].createdTime.slice(5,10)+'/'+weight[i].createdTime.slice(11,16))
          weight_y_data[i] = weight[i].weight
        }
        this.setData({
          weight_x_data:weight_x_data,
          weight_y_data:weight_y_data
        })
      }
      
    })
  },

  querybloodGlucoses(moment,startTime,endTime){
    var moment1 = moment
    const that = this
    wx.request({
      url: 'https://zhixiao.site:8080/health/bloodGlucose/query',
      data:{
        startTime:startTime,
        endTime:endTime,
        elderlyId:wx.getStorageSync('elderId'),
        moment:moment
      },
      header:{
        'Cookie':wx.getStorageSync('JSESSIONID')
      },
      success:(res)=>{
        
        if(startTime.slice(0,10)==endTime.slice(0,10)){
          console.log("今日血糖")
          console.log(res)
          if(res.data.data == null){
            if(moment1=='空腹'){
              this.setData({
                bloodGlucose_empty:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='早餐前'){
              this.setData({
                bloodGlucose_beforeBreakfast:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='早餐后'){
              this.setData({
                bloodGlucose_afterBreakfast:
                [
                    {
                      time:'',
                      count:'',
                    }
                ], 
              })
            }else if(moment1=='午餐前'){
              this.setData({
                bloodGlucose_beforeLunch:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='午餐后'){
              this.setData({
                bloodGlucose_afterLunch:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='晚餐前'){
              this.setData({
                bloodGlucose_beforeDinner:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='晚餐后'){
              this.setData({
                bloodGlucose_afterDinner:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='睡前'){
              this.setData({
                bloodGlucose_beforeSleep:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }else if(moment1=='凌晨'){
              this.setData({
                bloodGlucose_beforeDawn:
                [
                    {
                      time:'',
                      count:'',
                    }
                ],
              })
            }
            return
          }
          var bloodGlucose = res.data.data.bloodGlucoses
          var bloodGlucoseList = []
          for(var i in bloodGlucose){
            var obj = {}
            obj.time = bloodGlucose[i].createdTime.slice(11,16)
            obj.count = bloodGlucose[i].bloodGlucose
            obj.moment = bloodGlucose[i].moment
            console.log("查询到的血糖")
            console.log(moment)
            console.log(obj)
            if(bloodGlucose[i].moment=='空腹'){
              var bloodGlucose_empty = []
              bloodGlucose_empty.push(obj)
              console.log("空腹血糖")
              console.log(obj)
              this.setData({
                bloodGlucose_empty:bloodGlucose_empty
              })
            }else if(bloodGlucose[i].moment=='早餐前'){
              var bloodGlucose_beforeBreakfast = []
              bloodGlucose_beforeBreakfast.push(obj)
              this.setData({
                bloodGlucose_beforeBreakfast:bloodGlucose_beforeBreakfast
              })
            }else if(bloodGlucose[i].moment=='早餐后'){
              var bloodGlucose_afterBreakfast = []
              bloodGlucose_afterBreakfast.push(obj)
              this.setData({
                bloodGlucose_afterBreakfast:bloodGlucose_afterBreakfast
              })
            }else if(bloodGlucose[i].moment=='午餐前'){
              var bloodGlucose_beforeLunch = []
              bloodGlucose_beforeLunch.push(obj)
              this.setData({
                bloodGlucose_beforeLunch:bloodGlucose_beforeLunch
              })
            }else if(bloodGlucose[i].moment=='午餐后'){
              var bloodGlucose_afterLunch = []
              bloodGlucose_afterLunch.push(obj)
              this.setData({
                bloodGlucose_afterLunch:bloodGlucose_afterLunch
              })
            }else if(bloodGlucose[i].moment=='晚餐前'){
              var bloodGlucose_beforeDinner = []
              bloodGlucose_beforeDinner.push(obj)
              this.setData({
                bloodGlucose_beforeDinner:bloodGlucose_beforeDinner
              })
            }else if(bloodGlucose[i].moment=='晚餐后'){
              var bloodGlucose_afterDinner = []
              bloodGlucose_afterDinner.push(obj)
              this.setData({
                bloodGlucose_afterDinner:bloodGlucose_afterDinner
              })
            }else if(bloodGlucose[i].moment=='睡前'){
              var bloodGlucose_beforeSleep = []
              bloodGlucose_beforeSleep.push(obj)
              this.setData({
                bloodGlucose_beforeSleep:bloodGlucose_beforeSleep
              })
            }else if(bloodGlucose[i].moment=='凌晨'){
              var bloodGlucose_beforeDawn = []
              bloodGlucose_beforeDawn.push(obj)
              this.setData({
                bloodGlucose_beforeDawn:bloodGlucose_beforeDawn
              })
            }
          }
         
          return
          
        }
        console.log(res)
        if(res.data.msg==='无记录'||res.data.data===null){
          return
        }
        var bloodGlucoses = res.data.data.bloodGlucoses
        var moment = bloodGlucoses[0].moment
        var bloodGlucose_empty_x_data=[]
        var bloodGlucose_afterBreakfast_x_data=[]
        var bloodGlucose_beforeBreakfast_x_data=[]
        var bloodGlucose_beforeLunch_x_data=[]
        var bloodGlucose_afterLunch_x_data=[]
        var bloodGlucose_afterDinner_x_data=[]
        var bloodGlucose_beforeDinner_x_data=[]
        var bloodGlucose_beforeSleep_x_data=[]
        var bloodGlucose_beforeDawn_x_data=[]
        var bloodGlucose_empty_y_data=[]
        var bloodGlucose_afterBreakfast_y_data=[]
        var bloodGlucose_beforeBreakfast_y_data=[]
        var bloodGlucose_beforeLunch_y_data=[]
        var bloodGlucose_afterLunch_y_data=[]
        var bloodGlucose_afterDinner_y_data=[]
        var bloodGlucose_beforeDinner_y_data=[]
        var bloodGlucose_beforeSleep_y_data=[]
        var bloodGlucose_beforeDawn_y_data=[]
       
        switch(moment){
          case '空腹':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_empty_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_empty_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_empty_y_data:bloodGlucose_empty_y_data,
                bloodGlucose_empty_x_data:bloodGlucose_empty_x_data
              })
            }
            break
            case '早餐前':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_beforeBreakfast_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_beforeBreakfast_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_beforeBreakfast_y_data:bloodGlucose_beforeBreakfast_y_data,
                bloodGlucose_beforeBreakfast_x_data:bloodGlucose_beforeBreakfast_x_data

              })
            }
            break
            case '早餐后':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_afterBreakfast_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_afterBreakfast_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_afterBreakfast_y_data:bloodGlucose_afterBreakfast_y_data,
                bloodGlucose_afterBreakfast_x_data:bloodGlucose_afterBreakfast_x_data

              })
            }
            break
            case '午餐前':
            {
              for (var i in bloodGlucoses){
                
                bloodGlucose_beforeLunch_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_beforeLunch_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_beforeLunch_y_data:bloodGlucose_beforeLunch_y_data,
                bloodGlucose_beforeLunch_x_data:bloodGlucose_beforeLunch_x_data

              })
            }
            break
            case '午餐后':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_afterLunch_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_afterLunch_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_afterLunch_y_data:bloodGlucose_afterLunch_y_data,
                bloodGlucose_afterLunch_x_data:bloodGlucose_afterLunch_x_data

              })
            }
            break
            case '晚餐前':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_beforeDinner_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_beforeDinner_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_beforeDinner_y_data:bloodGlucose_beforeDinner_y_data,
                bloodGlucose_beforeDinner_x_data:bloodGlucose_beforeDinner_x_data

              })
            }
            break
            case '晚餐后':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_afterDinner_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_afterDinner_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_afterDinner_y_data:bloodGlucose_afterDinner_y_data,
                bloodGlucose_afterDinner_x_data:bloodGlucose_afterDinner_x_data

              })
            }
            break
            case '睡前':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_beforeSleep_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_beforeSleep_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
              this.setData({
                bloodGlucose_beforeSleep_y_data:bloodGlucose_beforeSleep_y_data,
                bloodGlucose_beforeSleep_x_data:bloodGlucose_beforeSleep_x_data

              })
            }
            break
            case '凌晨':
            {
              for (var i in bloodGlucoses){
                bloodGlucose_beforeDawn_x_data.push(bloodGlucoses[i].createdTime.slice(5,10))
                bloodGlucose_beforeDawn_y_data.push(bloodGlucoses[i].bloodGlucose)
              }
            
              this.setData({
                bloodGlucose_beforeDawn_y_data:bloodGlucose_beforeDawn_y_data,
                bloodGlucose_beforeDawn_x_data:bloodGlucose_beforeDawn_x_data
              })
            }
            break
            
        }

      },
      
    })
  },
  querybloodPressure(startTime,endTime){
    const that = this

    wx.request({
      url: 'https://zhixiao.site:8080/health/bloodPressure/query',
      data:{
        startTime:startTime,
        endTime:endTime,
        elderlyId:wx.getStorageSync('elderId')
      },
      header:{
        'Cookie':wx.getStorageSync('JSESSIONID')
      },
      success:(res)=>{
        
        if(startTime.slice(0,10)==endTime.slice(0,10)){
          console.log(res)
          console.log("今日血压")
          if(res.data.data==null){
            this.setData({
              pressureList:
              [
                {
                  diastolicPressure:
                  {
                    time:'',
                    count:'',
                  },
                  systolicPressure:
                  {
                    time:'',
                    count:'',
                  }
                }
              ],
            })
            return
          }
          var bloodPressure = res.data.data.bloodPressure
          var pressureList = []
          for(var i in bloodPressure){
            var obj = {}
            obj.systolicPressure = {}
            obj.diastolicPressure = {}
            obj.systolicPressure.time = bloodPressure[i].createdTime.slice(11,16)
            obj.diastolicPressure.time = bloodPressure[i].createdTime.slice(11,16)
            obj.diastolicPressure.count = bloodPressure[i].diastolicPressure
            obj.systolicPressure.count = bloodPressure[i].systolicPressure
            pressureList.push(obj)
          }
          this.setData({
            pressureList:pressureList
          })
          return
          
        }
        console.log("血压")
        console.log(res)
        if(res.data.data==null)
        {
          console.log("血压null")
          return
        }
        var bloodPressure = res.data.data.bloodPressure
        
        var diastolicPressure_x_data = []
        var systolicPressure_x_data = []
        var diastolicPressure_y_data = []
        var systolicPressure_y_data = []
        for(var i = 0;i<bloodPressure.length;i++){
          diastolicPressure_x_data.push(bloodPressure[i].createdTime.slice(5,10)+'/'+bloodPressure[i].createdTime.slice(11,16))
          systolicPressure_x_data.push(bloodPressure[i].createdTime.slice(5,10)+'/'+bloodPressure[i].createdTime.slice(11,16))
          diastolicPressure_y_data.push(bloodPressure[i].diastolicPressure)
          systolicPressure_y_data.push(bloodPressure[i].systolicPressure)
        }
        this.setData({
          diastolicPressure_x_data:diastolicPressure_x_data,
          systolicPressure_x_data:systolicPressure_x_data,
          diastolicPressure_y_data:diastolicPressure_y_data,
          systolicPressure_y_data:systolicPressure_y_data
        })
      }
    })
  },
  queryTemperature(startTime,endTime){
    const that = this

    wx.request({
      url: 'https://zhixiao.site:8080/health/bodyTemperature/info',
      data:{
        startTime:startTime,
        endTime:endTime,
        elderlyId:wx.getStorageSync('elderId')
      },
      header:{
        'Cookie':wx.getStorageSync('JSESSIONID')
      },
      success:(res)=>{
        if(startTime.slice(0,10)==endTime.slice(0,10)){
          console.log(res)
          console.log("今日体温")
          
          var temperature = res.data.data
          if(temperature==null){
            this.setData({
              temperatureList:
              [
                {
                  oralTemperature:
                  {
                    time:'',
                    count:'',
                  },
                  axillaryTemperature:
                  {
                    time:'',
                    count:'',
                  },
                  rectalTemperature:
                  {
                    time:'',
                    count:'',
                  }
                }
              ],
            })
            return
          }
          var temperatureList = []
          for(var i in temperature){
            var obj = {}
            obj.axillaryTemperature = {}
            obj.oralTemperature = {}
            obj.rectalTemperature = {}
            obj.axillaryTemperature.time = temperature[i].createdTime.slice(11,16)
            obj.oralTemperature.time = temperature[i].createdTime.slice(11,16)
            obj.rectalTemperature.time = temperature[i].createdTime.slice(11,16)

            obj.axillaryTemperature.count = temperature[i].axillaryTemperature
            obj.oralTemperature.count = temperature[i].oralTemperature
            obj.rectalTemperature.count = temperature[i].rectalTemperature

            temperatureList.push(obj)
          }
          this.setData({
            temperatureList:temperatureList
          })
          return
          
        }
        console.log("体温")
        console.log(res)
        if(res.data.data===null){
          return
        }
        var temperature = res.data.data
        if(temperature==null)
        {
          return
        }
        console.log(temperature)
        var oralTemperature_y_data = this.data.oralTemperature_y_data
        var rectalTemperature_y_data = this.data.rectalTemperature_y_data
        var axillaryTemperature_y_data = this.data.axillaryTemperature_y_data
        var oralTemperature_x_data = this.data.oralTemperature_x_data
        var rectalTemperature_x_data = this.data.rectalTemperature_x_data
        var axillaryTemperature_x_data = this.data.axillaryTemperature_x_data
        for(var i = 0;i<temperature.length;i++){
          oralTemperature_x_data.push(temperature[i].createdTime.slice(5,10)+'/'+temperature[i].createdTime.slice(11,16),)
          rectalTemperature_x_data.push(temperature[i].createdTime.slice(5,10)+'/'+temperature[i].createdTime.slice(11,16),)
          axillaryTemperature_x_data.push(temperature[i].createdTime.slice(5,10)+'/'+temperature[i].createdTime.slice(11,16),)
          axillaryTemperature_y_data.push(temperature[i].axillaryTemperature)
          oralTemperature_y_data.push(temperature[i].oralTemperature)
          rectalTemperature_y_data.push(temperature[i].rectalTemperature)
          this.setData({
            oralTemperature_x_data:oralTemperature_x_data,
            axillaryTemperature_y_data:axillaryTemperature_y_data,
            oralTemperature_y_data:oralTemperature_y_data,
            rectalTemperature_y_data:rectalTemperature_y_data,
          })
        }

      }
    })
  },
  queryheartRate(startTime,endTime){
    const that = this
    wx.request({
      url: 'https://zhixiao.site:8080/health/bodyHeartRate/query',
      data:{
        startTime:startTime,
        endTime:endTime,
        elderlyId:wx.getStorageSync('elderId')
      },
      header:{
        'Cookie':wx.getStorageSync('JSESSIONID')
      },
      success:(res)=>{
        if(startTime.slice(0,10)==endTime.slice(0,10)){
          console.log(res)
          console.log("今日心率")
          var heartRate = res.data.data
          if(heartRate==null){
            this.setData({
              heartRateList:
              [
                {
                  time:'',
                  count:'',
                }
              ],
            })
            return
          }
          var heartRateList = []
          for(var i in heartRate){
            var obj = {}
            obj.time = heartRate[i].createdTime.slice(11,16)
            obj.count = heartRate[i].heartRate
            heartRateList.push(obj)
          }
          this.setData({
            heartRateList:heartRateList
          })
          return
          
        }
        console.log("心率")
        console.log(res)
        var heartRate = res.data.data
        if(heartRate==null){
          return
        }
        var heartRate_x_data = []
        var heartRate_y_data = []
        for(var i=0;i<heartRate.length;i++){
          heartRate_x_data.push(heartRate[i].createdTime.slice(5,10)+'/'+heartRate[i].createdTime.slice(11,16),)
          heartRate_y_data.push(heartRate[i].heartRate)
        }
        this.setData({
          heartRate_x_data:heartRate_x_data,
          heartRate_y_data:heartRate_y_data
        })
      },
      complete:(res)=>{
        var heartRate = res.data.data
        if(heartRate==null){
          return
        }
        this.OnWxChart1(this.data.heartRate_x_data,'心率',this.data.heartRate_y_data)

        
      },
      
    })
  },
  //更换折线图数据为心率数据
  canvas1_click:function(){
    
    this.setData({
      textcolor1:'#014f8e',
      textcolor2:'#bfbfbf',
      textcolor3:'#bfbfbf',
      textcolor4:'#bfbfbf',
      textcolor5:'#bfbfbf',
      
      background1:'pink',
      background2:'#fff',
      background3:'#fff',
      background4:'#fff',
      background5:'#fff',
    })  
  
    var x_data=[]
    var y_data= []
    //绘制折线图
    var range = [60,180]
    if(this.data.heartRate_x_data.length===0){
      this.OnWxChart(x_data,y_data,'心率',range)
      return
    }
    this.OnWxChart1(this.data.heartRate_x_data,'心率',this.data.heartRate_y_data)
  },
  
  //更换折线图数据为血压数据
  canvas2_click:function(){
    this.setData({
      textcolor1:'#bfbfbf',
      textcolor2:'#014f8e',
      textcolor3:'#bfbfbf',
      textcolor4:'#bfbfbf',
      textcolor5:'#bfbfbf',
      background1:'#fff',
      background2:'pink',
      background3:'#fff',
      background4:'#fff',
      background5:'#fff',
    })
    var x_data=[]
    var y_data= []
    var range = [50,170]
    //绘制折线图
    if(this.data.diastolicPressure_x_data.length===0){
      this.OnWxChart(x_data,y_data,'血压',range)
      return
    }
    this.OnWxChart1(this.data.diastolicPressure_x_data,'舒张压',this.data.diastolicPressure_y_data,this.data.systolicPressure_y_data,'收缩压')
  },

    //更换折线图数据为血糖数据
    canvas3_click:function(){
      this.setData({
        textcolor1:'#bfbfbf',
        textcolor2:'#bfbfbf',
        textcolor3:'#014f8e',
        textcolor4:'#bfbfbf',
        textcolor5:'#bfbfbf',
        background1:'#fff',
        background2:'#fff',
        background3:'pink',
        background4:'#fff',
        background5:'#fff',
      })
      
      var x_data=[]
      var y_data= []
      var range = [3,9]
      //绘制折线图
      
      if(this.data.bloodGlucose_empty_x_data.length===0){
        this.OnWxChart(x_data,y_data,'血糖',range)
        return
      }
      var x_data = []
      var bloodGlucose_empty_x_data = this.data.bloodGlucose_empty_x_data
      var bloodGlucose_beforeBreakfast_x_data = this.data.bloodGlucose_beforeBreakfast_x_data
      var bloodGlucose_afterBreakfast_x_data = this.data.bloodGlucose_afterBreakfast_x_data
      var bloodGlucose_beforeLunch_x_data = this.data.bloodGlucose_beforeLunch_x_data
      var bloodGlucose_afterLunch_x_data = this.data.bloodGlucose_afterLunch_x_data
      var bloodGlucose_beforeDinner_x_data = this.data.bloodGlucose_beforeDinner_x_data
      var bloodGlucose_afterDinner_x_data = this.data.bloodGlucose_afterDinner_x_data
      var bloodGlucose_beforeSleep_x_data = this.data.bloodGlucose_beforeSleep_x_data
      var bloodGlucose_beforeDawn_x_data = this.data.bloodGlucose_beforeDawn_x_data
      for(var i in bloodGlucose_empty_x_data){
        var time = bloodGlucose_empty_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_beforeBreakfast_x_data){
        var time = bloodGlucose_beforeBreakfast_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_afterBreakfast_x_data){
        var time = bloodGlucose_afterBreakfast_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_beforeLunch_x_data){
        var time = bloodGlucose_beforeLunch_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_afterLunch_x_data){
        var time = bloodGlucose_afterLunch_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_beforeDinner_x_data){
        var time = bloodGlucose_beforeDinner_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_afterDinner_x_data){
        var time = bloodGlucose_afterDinner_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_beforeSleep_x_data){
        var time = bloodGlucose_beforeSleep_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      for(var i in bloodGlucose_beforeDawn_x_data){
        var time = bloodGlucose_beforeDawn_x_data[i]
        if(x_data.indexOf(time)==-1){
          x_data.push(time)
        }
      }
      this.setData({
        x_data:x_data
      })
      var bloodGlucose_empty_y_data= this.data.bloodGlucose_empty_y_data
      var bloodGlucose_afterBreakfast_y_data=this.data.bloodGlucose_afterBreakfast_y_data
      var bloodGlucose_beforeBreakfast_y_data=this.data.bloodGlucose_beforeBreakfast_y_data
      var bloodGlucose_beforeLunch_y_data=this.data.bloodGlucose_beforeLunch_y_data
      var bloodGlucose_afterLunch_y_data=this.data.bloodGlucose_afterLunch_y_data
      var bloodGlucose_afterDinner_y_data=this.data.bloodGlucose_afterDinner_y_data
      var bloodGlucose_beforeDinner_y_data=this.data.bloodGlucose_beforeDinner_y_data
      var bloodGlucose_beforeSleep_y_data=this.data.bloodGlucose_beforeSleep_y_data
      var bloodGlucose_beforeDawn_y_data=this.data.bloodGlucose_beforeDawn_y_data
      for(var i in x_data){
        var index1 = bloodGlucose_empty_x_data.indexOf(x_data[i])
        var index2 = bloodGlucose_afterBreakfast_x_data.indexOf(x_data[i])
        var index3= bloodGlucose_beforeBreakfast_x_data.indexOf(x_data[i])
        var index4= bloodGlucose_beforeLunch_x_data.indexOf(x_data[i])
        var index5= bloodGlucose_afterLunch_x_data.indexOf(x_data[i])
        var index6= bloodGlucose_afterDinner_x_data.indexOf(x_data[i])
        var index7= bloodGlucose_beforeDinner_x_data.indexOf(x_data[i])
        var index8= bloodGlucose_beforeSleep_x_data.indexOf(x_data[i])
        var index9= bloodGlucose_beforeDawn_x_data.indexOf(x_data[i])
        if(index1==-1){
          bloodGlucose_empty_y_data.splice(i,0,null)
        }
        if(index2==-1){
          bloodGlucose_afterBreakfast_y_data.splice(i,0,null)
        }
        if(index3==-1){
          bloodGlucose_beforeBreakfast_y_data.splice(i,0,null)

        }
        if(index4==-1){
          bloodGlucose_beforeLunch_y_data.splice(i,0,null)

        }
        if(index5==-1){
          bloodGlucose_afterLunch_y_data.splice(i,0,null)


        }
        if(index6==-1){
          bloodGlucose_afterDinner_y_data.splice(i,0,null)


        }
        if(index7==-1){
          bloodGlucose_beforeDinner_y_data.splice(i,0,null)


        }
        if(index8==-1){
          bloodGlucose_beforeSleep_y_data.splice(i,0,null)


        }
        if(index9==-1){
          bloodGlucose_beforeDawn_y_data.splice(i,0,null)

        }
      }
      this.setData({
        bloodGlucose_empty_y_data:bloodGlucose_empty_y_data,
        bloodGlucose_afterBreakfast_y_data:bloodGlucose_afterBreakfast_y_data,
        bloodGlucose_beforeBreakfast_y_data:bloodGlucose_beforeBreakfast_y_data,
        bloodGlucose_beforeLunch_y_data:bloodGlucose_beforeLunch_y_data,
        bloodGlucose_afterLunch_y_data:bloodGlucose_afterLunch_y_data,
        bloodGlucose_afterDinner_y_data:bloodGlucose_afterDinner_y_data,
        bloodGlucose_beforeDinner_y_data:bloodGlucose_beforeDinner_y_data,
        bloodGlucose_beforeSleep_y_data:bloodGlucose_beforeSleep_y_data,
        bloodGlucose_beforeDawn_y_data:bloodGlucose_beforeDawn_y_data
      })
      this.OnWxChart2(x_data,'空腹',this.data.bloodGlucose_empty_y_data,'早餐前',this.data.bloodGlucose_beforeBreakfast_y_data,'早餐后',this.data.bloodGlucose_afterBreakfast_y_data,'午餐前',this.data.bloodGlucose_beforeLunch_y_data,'午餐后',this.data.bloodGlucose_afterLunch_y_data,'晚餐前',this.data.bloodGlucose_beforeBreakfast_y_data,'晚餐后',this.data.bloodGlucose_afterDinner_y_data,'睡前',this.data.bloodGlucose_beforeSleep_y_data,'凌晨',this.data.bloodGlucose_beforeDawn_y_data)
    },

     //更换折线图数据为体温数据
    canvas4_click:function(){
      this.setData({
        textcolor1:'#bfbfbf',
        textcolor2:'#bfbfbf',
        textcolor3:'#bfbfbf',
        textcolor4:'#014f8e',
        textcolor5:'#bfbfbf',
        background1:'#fff',
        background2:'#fff',
        background3:'#fff',
        background4:'pink',
        background5:'#fff',
      })
      var x_data=[]
      var y_data= []
      var range = [34,42]
      //绘制折线图

      if(this.data.axillaryTemperature_x_data.length===0){
        this.OnWxChart(x_data,y_data,'体温',range)
        return
      }
      
      this.OnWxChart1(this.data.axillaryTemperature_x_data,'腋温',this.data.axillaryTemperature_y_data,this.data.oralTemperature_y_data,'口腔温',this.data.rectalTemperature_y_data,'肛温')
    },
     //更换折线图数据为体重数据
    canvas5_click:function(){
      this.setData({
        textcolor1:'#bfbfbf',
        textcolor2:'#bfbfbf',
        textcolor3:'#bfbfbf',
        textcolor4:'#bfbfbf',
        textcolor5:'#014f8e',
        background1:'#fff',
        background2:'#fff',
        background3:'#fff',
        background4:'#fff',
        background5:'pink',
      })
      var x_data=[]
      var y_data= []
      var range = [60,120]
      //绘制折线图
      if(this.data.weight_x_data.length===0){
        this.OnWxChart(x_data,y_data,'体重',range)
        return
      }


      this.OnWxChart1(this.data.weight_x_data,'体重',this.data.weight_y_data)
    },
 //图表点击事件
 touchcanvas:function(e){
  lineChart.showToolTip(e, {
    format: function (item, category) {
      return category + ' ' + item.name + ':' + item.data
    }
  });
},
//折线图绘制方法
OnWxChart:function(x_data,y_data,name,range){
  
  var windowWidth = '', windowHeight='';    //定义宽高
  try {
    var res = wx.getSystemInfoSync();    //试图获取屏幕宽高数据
    windowWidth = res.windowWidth / 750 * 690;   //以设计图750为主进行比例算换
    windowHeight = res.windowWidth / 750 * 690    //以设计图750为主进行比例算换
    console.log(windowWidth)
    if(this.data.diastolicPressure_x_data.length>5){
      windowWidth = this.data.diastolicPressure_x_data.length*70
      this.setData({
        width:windowWidth+40
      })
    }
  } catch (e) {
    console.error('getSystemInfoSync failed!');   //如果获取失败
  }
  lineChart = new wxCharts({
    canvasId: 'lineCanvas',     //输入wxml中canvas的id
    type: 'line',     
    categories:x_data,    //模拟的x轴横坐标参数
    animation: true,  //是否开启动画
   
    series: [{
      name: name,
      data: y_data,
      format: function (val, name) {
        return val ;
      }
    }
    ],
    xAxis: {   //是否隐藏x轴分割线
      disableGrid: true,
      fontColor:'black',
      
    },
    yAxis: {      //y轴数据
      title: '',  //标题
      format: function (val) {  //返回数值
        return val.toFixed(2);
      },
      min: range[0],   //最小值
      max: range[1],
      
      gridColor: '#D8D8D8',
      fontColor:'black'
      
    },
    width: windowWidth*1.1,  //图表展示内容宽度
    height: windowHeight,  //图表展示内容高度
    dataLabel: true,  //是否在图表上直接显示数据
    dataPointShape: true, //是否在图标上显示数据点标志
    extra: {
      lineStyle: 'Broken'  //曲线
    },
  });
},


OnWxChart1:function(x_data,name,y1_data,y2_data,name2,y3_data,name3){
  var windowWidth = wx.getSystemInfoSync().windowWidth/750*690
    this.setData({
      width:windowWidth
    })
  var windowWidth = '', windowHeight='';    //定义宽高
  try {
    var res = wx.getSystemInfoSync();    //试图获取屏幕宽高数据
    windowWidth = res.windowWidth / 750 * 690;   //以设计图750为主进行比例算换
    windowHeight = res.windowWidth / 750 * 550    //以设计图750为主进行比例算换
    if(x_data.length>7){
        windowWidth = x_data.length*50
        this.setData({
          width:windowWidth+40
        })
    }
  } catch (e) {
    console.error('getSystemInfoSync failed!');   //如果获取失败
  }
  if(y2_data===undefined){
    lineChart = new wxCharts({
      canvasId: 'lineCanvas',     //输入wxml中canvas的id
      type: 'line',     
      categories:x_data,    //模拟的x轴横坐标参数
      animation: true,  //是否开启动画
      series: [{
        name: name,
        data: y1_data,
        format: function (val, name) {
          return val ;
        }
      }
      ],
      xAxis: {   //是否隐藏x轴分割线
        disableGrid: true,
      },
      yAxis: {      //y轴数据
        title: '',  //标题
        format: function (val) {  //返回数值
          return val.toFixed(2);
        },
        min: x_data.min,   //最小值
        max: x_data.max,
        fontColor:'black',
        gridColor: '#D8D8D8',
      },
      width: windowWidth*1.1,  //图表展示内容宽度
      height: windowHeight,  //图表展示内容高度
      dataLabel: true,  //是否在图表上直接显示数据
      dataPointShape: true, //是否在图标上显示数据点标志
      extra: {
        lineStyle: 'Broken'  //曲线
      },
    });
  }else if(y3_data===undefined)
  {
    lineChart = new wxCharts({
      canvasId: 'lineCanvas',     //输入wxml中canvas的id
      type: 'line',     
      categories:x_data,    //模拟的x轴横坐标参数
      animation: true,  //是否开启动画
      series: [{
        name: name,
        data: y1_data,
        format: function (val, name) {
          return val ;
        }
      },
      {
        name: name2,
        data: y2_data,
        format: function (val, name2) {
          return val ;
        }
      }
      ],
      xAxis: {   //是否隐藏x轴分割线
        disableGrid: true,
      },
      yAxis: {      //y轴数据
        title: '',  //标题
        format: function (val) {  //返回数值
          return val.toFixed(2);
        },
        min: x_data.min,   //最小值
        max: x_data.max,
        fontColor:'black',
        gridColor: '#D8D8D8',
      },
      width: windowWidth*1.1,  //图表展示内容宽度
      height: windowHeight,  //图表展示内容高度
      dataLabel: true,  //是否在图表上直接显示数据
      dataPointShape: true, //是否在图标上显示数据点标志
      extra: {
        lineStyle: 'Broken'  //曲线
      },
    });
  }else{
    lineChart = new wxCharts({
      canvasId: 'lineCanvas',     //输入wxml中canvas的id
      type: 'line',     
      categories:x_data,    //模拟的x轴横坐标参数
      animation: true,  //是否开启动画
      series: [{
        name: name,
        data: y1_data,
        format: function (val, name) {
          return val ;
        }
      },
      {
        name: name2,
        data: y2_data,
        format: function (val, name2) {
          return val ;
        }
      },
      {
        name: name3,
        data: y3_data,
        format: function (val, name3) {
          return val ;
        }
      }
      ],
      xAxis: {   //是否隐藏x轴分割线
        disableGrid: true,
      },
      yAxis: {      //y轴数据
        title: '',  //标题
        format: function (val) {  //返回数值
          return val.toFixed(2);
        },
        min: x_data.min,   //最小值
        max: x_data.max,
        fontColor:'black',
        gridColor: '#D8D8D8',
      },
      width: windowWidth*1.1,  //图表展示内容宽度
      height: windowHeight,  //图表展示内容高度
      dataLabel: true,  //是否在图表上直接显示数据
      dataPointShape: true, //是否在图标上显示数据点标志
      extra: {
        lineStyle: 'Broken'  //曲线
      },
    });
  }

},



OnWxChart2:function(x_data,name1,y1_data,name2,y2_data,name3,y3_data,name4,y4_data,name5,y5_data,name6,y6_data,name7,y7_data,name8,y8_data,name9,y9_data){
  
  var windowWidth = '', windowHeight='';    //定义宽高
  try {
    var res = wx.getSystemInfoSync();    //试图获取屏幕宽高数据
    windowWidth = res.windowWidth / 750 * 690;   //以设计图750为主进行比例算换
    windowHeight = res.windowWidth / 750 * 550    //以设计图750为主进行比例算换
    if(x_data.length>7){
        windowWidth = x_data.length*50
        this.setData({
          width:windowWidth+40
        })
    }
  } catch (e) {
    console.error('getSystemInfoSync failed!');   //如果获取失败
  }
 
  lineChart = new wxCharts({
    canvasId: 'lineCanvas',     //输入wxml中canvas的id
    type: 'line',     
    categories:x_data,    //模拟的x轴横坐标参数
    animation: true,  //是否开启动画
    series: [{
      name: name1,
      data: y1_data,
      format: function (val, name) {
        return val ;
      }
    },
    {
      name: name2,
      data: y2_data,
      format: function (val, name2) {
        return val ;
      }
    },
    {
      name: name3,
      data: y3_data,
      format: function (val, name3) {
        return val ;
      }
    },
    {
      name: name4,
      data: y4_data,
      format: function (val, name4) {
        return val ;
      }
    },
    {
      name: name5,
      data: y5_data,
      format: function (val, name5) {
        return val ;
      }
    },
    {
      name: name6,
      data: y6_data,
      format: function (val, name6) {
        return val ;
      }
    },
    {
      name: name7,
      data: y7_data,
      format: function (val, name7) {
        return val ;
      }
    },
    {
      name: name8,
      data: y8_data,
      format: function (val, name8) {
        return val ;
      }
    },
    {
      name: name9,
      data: y9_data,
      format: function (val, name9) {
        return val ;
      }
    }
    ],
    xAxis: {   //是否隐藏x轴分割线
      disableGrid: true,
    },
    yAxis: {      //y轴数据
      title: '',  //标题
      format: function (val) {  //返回数值
        return val.toFixed(2);
      },
      min: x_data.min,   //最小值
      max: x_data.max,
      fontColor:'black',
      gridColor: '#D8D8D8',
    },
    width: windowWidth*1.1,  //图表展示内容宽度
    height: windowHeight,  //图表展示内容高度
    dataLabel: true,  //是否在图表上直接显示数据
    dataPointShape: true, //是否在图标上显示数据点标志
    extra: {
      lineStyle: 'Broken'  //曲线
    },
  });

},

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})